﻿using System.Xml;
using System.Xml.Linq;
using XnaXaml.Xaml;

namespace XnaXaml.Controls
{
    public class Page : ContainerControl
    {
        #region Properties

        #endregion

        #region Constructor
        
        public Page() { }
        public Page(XNode xmlNode) : base(xmlNode) { }

        #endregion

        #region Methods

        public override void Generate(XamlRenderer renderer)
        {
            renderer.GeneratePage(this);

            for (var i = 0; i < Children.Count; i++)
            {
                var child = Children[i];
                child.Generate(renderer);
            }
        }

        public override void Render(XamlRenderer renderer)
        {
            renderer.RenderPage(this);

            for (var i = 0; i < Children.Count; i++)
            {
                var child = Children[i];
                child.Render(renderer);
            }
        }

        #endregion
    }
}
